package model;

import com.jph.simple.R;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * Created by xueal on 2018/1/16.
 */

public class Friend extends BaseItem{

    private boolean isNewMessage;
    private boolean isOnline;

    private boolean isSelect = false;       // 创建群聊使用

    public static final int[] imageIds = { R.drawable.world, R.drawable.friend_1,
            R.drawable.friend_2, R.drawable.friend_3, R.drawable.friend_4, R.drawable.friend_5,
            R.drawable.friend_6, R.drawable.friend_7, R.drawable.friend_8, R.drawable.friend_9,
    };

    public Friend(int imageId, String name) {
        super(imageId, name);
        this.isNewMessage = false;
        this.isOnline = false;
    }

    public Friend(int imageId, String name, boolean isOnline) {
        super(imageId, name);
        this.isOnline = isOnline;
        this.isNewMessage = false;
    }

    public boolean getOnline() {
        return isOnline;
    }

    public void setOnline(boolean online) {
        isOnline = online;
    }

    public boolean getNewMessage() {
        return isNewMessage;
    }

    public void setNewMessage(boolean newMessage) {
        isNewMessage = newMessage;
    }

//    //    如果该对象小于、等于或大于指定对象，则分别返回负整数、零或正整数
//    @Override
//    public int compareTo(@NonNull Friend o) {
//        if (this.getOnline() && !o.getOnline()) //这里比较的是什么 sort方法实现的就是按照此比较的东西从小到大排列
//            return -1;
//        else if (!this.getOnline() && o.getOnline())
//            return 1;
//        else
//            return 0;
//    }

    public static int check(boolean tag){ return tag ? 1:0; }

    public boolean isSelect() {
        return isSelect;
    }

    public void setSelect(boolean select) {
        isSelect = select;
    }
}
